/**
 * 路由常量配置
 * 集中管理所有路由路径，避免硬编码
 */

export const ROUTES = {
  // 登录相关
  LOGIN: "/Login",

  // 后台管理
  BACKEND: {
    ROOT: "/Backend",
    SYSTEM_MANAGEMENT: {
      ROOT: "/Backend/SystemManagement",
      THEME_SETTINGS: "/Backend/SystemManagement/ThemeSettings",
      USER_MANAGEMENT: "/Backend/SystemManagement/UserManagement",
    },
  },
};

/**
 * 获取路由路径
 * @param {string} path - 路由路径字符串，支持点号分隔
 * @example getRoute('BACKEND.SYSTEM_MANAGEMENT.THEME_SETTINGS')
 */
export function getRoute(path) {
  return path.split(".").reduce((obj, key) => obj?.[key], ROUTES);
}
